import { request, METHOD } from "@/service/http.service";


export function getModelList() {
  return request({
    url: "/model",
    method: METHOD.GET,
  }).then(response => {
    const { result } = response.data;
    return result
  });
}

export function getModel(id: number) {
  return request({
    url: `/model/${id}`,
    method: METHOD.GET,
  });
}

export function createModel(data) {
  return request({
    url: "/model",
    method: METHOD.POST,
    data
  });
}


export function modifyModel(id: number, data) {
  return request({
    url: `/model/${id}`,
    method: METHOD.PUT,
    data
  });
}


export function removeModel(id: number) {
  return request({
    url: `/model/${id}`,
    method: METHOD.DELETE,
  });
}


export function uploadModel(id:number, data) {
  return request({
    url: `/model/${id}`,
    method: METHOD.POST,
    data
  });
}
